// 首页的数据仓库
import {reqCategoryList} from '@/api'

const state = {
    categoryList: []
}
const mutations = {
    CATEGORYLIST(state,categoryList){
        state.categoryList = categoryList
    }
}
const actions = {
    // 通过API接口函数，发请求
   async  categoryList({commit}){
    let result = await  reqCategoryList()
    if(result.code==200){
        commit('CATEGORYLIST',result.data)
        }
    }
}
const getters  = {}

export default {
    state,
    mutations,
    actions,
    getters
}